/**
 * Created with JetBrains WebStorm.
 * User:Gen
 * Date: 14-1-15
 * Time: 上午10:23
 * 仓库Store
 */
Ext.define("byb.store.system.Warehouse", {
    extend:"Ext.data.Store",
    autoLoad:false,
    model:"byb.model.system.Warehouse",
    proxy: {
        type: "ajax",
        api:{
            read:byb.Constant.APIRoot+"/org/userWarehouses"
        },
        reader:{
            type:"json",
            root:"results",
            successProperty:"success",
            totalProperty:"totalCount"
        }
    },
    userCustomProcess:function(data){
        if(data){
            var subType=data.subType?data.subType:"YLK";
            var url = byb.Constant.APIRoot+ "/org/userWarehouses";
            this.proxy.extraParams ={"subType":data.subType};
        }
    },
    constructor:function(){
        if(arguments.length>0){
            var data=arguments[0];
            this.userCustomProcess(data);
        }
        this.callParent(arguments);
    }
});